package com.home.customtest.config;

import com.custom.action.core.methods.MethodKind;
import com.custom.action.core.plugin.ExecuteInterceptor;
import com.custom.action.core.plugin.Intercepts;
import com.custom.action.core.plugin.Invocation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author XiaoBai
 * @since 2024/1/17 16:32
 */
@Component
@Slf4j
@Intercepts(include = {MethodKind.SELECT_BY_KEY})
public class MyExecInterceptor implements ExecuteInterceptor {
    @Override
    public Object intercept(Invocation invocation) throws Exception {
        log.info("拦截器执行>>> {}", invocation.getExecuteHandler().getKind().getMethod());
        return invocation.proceed();
    }
}
